import ZgtCheckbox from './checkbox';
import ZgtCheckboxGroup from './checkbox-group';
import ZgtDatetimePicker from './datetime-picker';
import ZgtDialog from './dialog';
import ZgtPicker from './picker';
import ZgtPopup from './popup';
import ZgtRadio from './radio';
import ZgtRadioGroup from './radio-group';
import ZgtToast from './toast';
import ZgtCell from './cell';
import ZgtCellGroup from './cell-group';
import ZgtField from './field';
import ZgtForm from './form';
import ZgtButton from './button';
import ZgtList from './list'
import ZgtPullRefresh from './pull-refresh'
var version = '1.0.0';

function install(Vue) {
  var components = [ZgtCheckbox, ZgtCheckboxGroup, ZgtDatetimePicker, ZgtDialog, ZgtPicker, ZgtPopup, ZgtRadio, ZgtRadioGroup, ZgtToast, ZgtCell, ZgtCellGroup, ZgtField, ZgtForm, ZgtButton, ZgtList, ZgtPullRefresh]; // 
  components.forEach(function (item) {
    if (item.install) {
      Vue.use(item);
    } else if (item.name) {
      Vue.component(item.name, item);
    }
  });
}

if (typeof window !== 'undefined' && window.Vue) {
  install(window.Vue);
}

export { install, version, ZgtCheckbox, ZgtCheckboxGroup, ZgtDatetimePicker, ZgtDialog, ZgtPicker, ZgtPopup, ZgtRadio, ZgtRadioGroup, ZgtToast, ZgtCell, ZgtCellGroup, ZgtField, ZgtForm, ZgtButton, ZgtList, ZgtPullRefresh}; // 
export default {
  install: install,
  version: version
};